home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Games Machine 103
/
XENIATGM103.iso
/
Shareware
/
GoLive 5.0
/
MM27.Cab
/
F857_JSASample.c.0162E57D_7C98_4D94_A1CA_6231808F03E6
< prev
next >
Wrap
Text File
|
2000-08-17
|
2KB
|
89 lines
/*************************************************************************
*
* ADOBE CONFIDENTIAL
* ___________________
*
* Copyright 2000 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains the property of
* Adobe Systems Incorporated and its suppliers, if any. The intellectual
* and technical concepts contained herein are proprietary to Adobe Systems
* Incorporated a nd its suppliers and may be covered by U. S. and Foreign
* Patents,patents in process,and are protected by trade secret or copyright
* law. Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained from
* Adobe Systems Incorporated.
*
**************************************************************************/
// ----------------------------------------------------------------
// JSASample.c
// Sample for the GoLive Extend Script SDK
// ----------------------------------------------------------------
#include "JSA.h"
#include <math.h>
#ifdef WIN32
#include <windows.h>
#else
#include <QuickDraw.h>
#endif
// Implement this macro once to set up the necessary structures.
JSA_INIT
// Return the power of arg1 to arg2.
static void power(int argc, JSValue *argv, JSValue returnValue)
{
double a, b, c;
a = JSAValueToDouble(argv[0]);
b = JSAValueToDouble(argv[1]);
c = pow (a, b);
JSADoubleToValue(returnValue, c);
}
// Draw an oval into the given rectangle. This demonstrates the
// use of the JSADrawInfo structure.
static void drawOval(int argc, JSValue *argv, JSValue returnValue)
{
long temp;
JSADrawInfo* info;
#ifdef WIN32
HDC dc;
temp = JSAValueToInt (argv[0]);
info = (JSADrawInfo*) temp;
dc = (HDC) info->context;
Ellipse (dc, info->left, info->top, info->right, info->bottom);
#else
Rect r;
temp = JSAValueToInt (argv[0]);
info = (JSADrawInfo*) temp;
r.left = (short) info->left;
r.top = (short) info->top;
r.right = (short) info->right;
r.bottom = (short) info->bottom;
FrameOval (&r);
#endif
}
// Implement the JSAMain function to register all callable functions.
void JSAEXPORT JSAMain(void)
{
JSARegisterFunction("power",power);
JSARegisterFunction("drawOval",drawOval);
}
// optional, may be omitted
void JSAEXPORT JSAExit(void)
{}